<?php

	class CMS_File
	{
		function __construct ($url)
		{
			if($url == "") 
			{
				$e = new Zend_View_Exception('CMS_File need a url as param.');
				throw $e;
			}
			$this->url = $url;
		}
		
		function write($sContent, $mode = "w")
		{
			$file = fopen($this->url, $mode);
			if(!$file) 
			{
				$e = new Zend_View_Exception($this->url . ' is not accessible.');
				throw $e;
			}
			else fwrite($file, utf8_encode($sContent));
		}
		
		function read()
		{
			return file_get_contents($this->url);
		}
		
		
	}



?>